<script>
	import loginService  from '@/service/login/LoginService.js'
	export default {
		globalData: {
			statusBarHeight:0, // 状态那一栏的高度 //导航栏高度 = 状态栏高度 + 44。
			capsule:{}, // 是个对象，包含宽高，以及四个坐标
			searchHeight:0, // 搜索框高度
			searchTop:0,// 搜索框离页面顶部距离
			navigationRightWidth:0, // 菜单按钮右侧所占的宽度
			capsuleToRight:0,// 菜单按钮离右侧的距离
			windowWidth:0,// 手机可是宽度
			
			type:'visitor',
		},
		onLaunch: function() {
			console.log('App Launch')
		},
		onShow: async function() {
			console.log('App Show')
			const that = this
			// 获取 微信胶囊的位置
			wx.getSystemInfo({
				success: e => {
					that.globalData.statusBarHeight = e.statusBarHeight
					let windowWidth = e.windowWidth
					that.globalData.windowWidth = windowWidth
					let capsule = wx.getMenuButtonBoundingClientRect();
					that.globalData.capsule = capsule
					that.globalData.searchHeight = capsule.height
					that.globalData.searchTop = capsule.top
					that.globalData.navigationRightWidth = (windowWidth - capsule.right) * 2 + capsule.width
					that.globalData.capsuleToRight = windowWidth - capsule.right
					// console.log(that.globalData.statusBarHeight,that.globalData.searchTop,windowWidth,that.globalData.searchHeight,that.globalData.capsule,that.globalData.navigationRightWidth,that.globalData.capsuleToRight)
				}
			})

			
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	/*每个页面公共css */
	@import "@/uni_modules/uview-ui/index.scss";
	@import url('@/common/css/iconfont.css');
</style>
